package hotkey

// Modifier represents a modifier.
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerhotkey
type Modifier uint8

// All kinds of Modifiers
const (
	ModAlt   Modifier = 0x1
	ModCtrl  Modifier = 0x2
	ModShift Modifier = 0x4
	ModWin   Modifier = 0x8
)

// Key represents a key.
// https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
type Key uint16

var keyCodeWin = map[string]Key{
	// 字母数字
	"0": 0x30,
	"1": 0x31,
	"2": 0x32,
	"3": 0x33,
	"4": 0x34,
	"5": 0x35,
	"6": 0x36,
	"7": 0x37,
	"8": 0x38,
	"9": 0x39,
	"a": 0x41,
	"b": 0x42,
	"c": 0x43,
	"d": 0x44,
	"e": 0x45,
	"f": 0x46,
	"g": 0x47,
	"h": 0x48,
	"i": 0x49,
	"j": 0x4A,
	"k": 0x4B,
	"l": 0x4C,
	"m": 0x4D,
	"n": 0x4E,
	"o": 0x4F,
	"p": 0x50,
	"q": 0x51,
	"r": 0x52,
	"s": 0x53,
	"t": 0x54,
	"u": 0x55,
	"v": 0x56,
	"w": 0x57,
	"x": 0x58,
	"y": 0x59,
	"z": 0x5A,
	// 数字键盘
	"num0": 0x60,
	"num1": 0x61,
	"num2": 0x62,
	"num3": 0x63,
	"num4": 0x64,
	"num5": 0x65,
	"num6": 0x66,
	"num7": 0x67,
	"num8": 0x68,
	"num9": 0x69,
	"num*": 0x6A,
	"num+": 0x6B,
	"num-": 0x6D,
	"num.": 0x6E,
	"num/": 0x6F,
	// 功能键
	"f1":  0x70,
	"f2":  0x71,
	"f3":  0x72,
	"f4":  0x73,
	"f5":  0x74,
	"f6":  0x75,
	"f7":  0x76,
	"f8":  0x77,
	"f9":  0x78,
	"f10": 0x79,
	"f11": 0x7A,
	"f12": 0x7B,
	"f13": 0x7C,
	"f14": 0x7D,
	"f15": 0x7E,
	"f16": 0x7F,
	"f17": 0x80,
	"f18": 0x81,
	"f19": 0x82,
	"f20": 0x83,
	"f21": 0x84,
	"f22": 0x85,
	"f23": 0x86,
	"f24": 0x87,
	// 控制键
	"backspace":   0x08,
	"tab":         0x09,
	"clear":       0x0C,
	"enter":       0x0D,
	"capslock":    0x14,
	"esc":         0x1B,
	"space":       0x20,
	"pageup":      0x21,
	"pagedown":    0x22,
	"end":         0x23,
	"home":        0x24,
	"left":        0x25,
	"right":       0x27,
	"up":          0x26,
	"down":        0x28,
	"select":      0x29,
	"print":       0x2A,
	"execute":     0x2B,
	"printscreen": 0x2C,
	"insert":      0x2D,
	"delete":      0x2E,
	"help":        0x2F,
	"numlock":     0x90,
	"scrolllock":  0x91,
	";":           0xBA,
	"=":           0xBB,
	",":           0xBC,
	"-":           0xBD,
	".":           0xBE,
	"/":           0xBF,
	"`":           0xC0,
	"[":           0xDB,
	"\\":          0xDC,
	"]":           0xDD,
	"'":           0xDE,
}
